import java.util.Comparator;
import java.util.PriorityQueue;

class Rob {
    
    public static int rob(int[] nums) {
        return rob(nums,0,nums.length,0);
    }
    public static int rob(int[] nums,int i,int len,int sum){
        if(i>=len){
            return sum;
        }
        int tmp=sum+nums[i];
        int a1=rob(nums,i+2,len,tmp);
         int a2=rob(nums,i+1,len,sum);
       return Math.max(a1,a2);
    }

    public static void main(String[] args) {
        int[] nums={1,2};
        System.out.println(rob(nums));
    }

}

